Skip to content

Conversation

@bash-c
Copy link

@bash-c bash-c commented Oct 14, 2025

When the peer closes the connection, socket.recv() returns b''.
The previous loop made no progress and could spin forever.
Break on empty chunk to avoid the infinite loop.

@anadrianmanrique anadrianmanrique added the bug Unexpected problem or unintended behavior label Oct 15, 2025
@anadrianmanrique anadrianmanrique self-assigned this Nov 6, 2025
@bash-c
Copy link
Author

bash-c commented Nov 17, 2025

Hi, any updates about this one?

@anadrianmanrique
Copy link
Collaborator

Hello, thanks for reporting the issue! Regarding changes, I would say it's ok, but returning from recv in the middle of an error condition wouldn't be the best. That would end up in another infinite loop in

while len(response_data) < response_header['frag_len']:
for instance. I think the best would be to raise an DCERPCException(), given that the contract of retrieving the exact amount of bytes can't be honored in that kind of error condition.
So, is there any specific scenario that you were able to replicate the issue? I'm curious about this, besides the fact that a connection should be close in the middle of receiving data, how this condition could be triggered through a high level use case.

@anadrianmanrique anadrianmanrique added the waiting for response Further information is needed from people who opened the issue or pull request label Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unexpected problem or unintended behavior waiting for response Further information is needed from people who opened the issue or pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants